package com.hex.liyue.commonmodule.view.scrollbanner;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.hex.liyue.R;

/**
 * ImageView创建工厂
 */
public class ViewFactory {

    /**
     * 获取ImageView视图的同时加载显示url
     *
     * @param url
     * @return
     */
    public static ImageView getImageView(Context context, String url) {
        ImageView imageView = (ImageView) View.inflate(context,
                R.layout.item_view_banner, null);
//        Glide.with(context).load(ConstantUrl.getBaseUrl() + url).into(imageView);
        Glide.with(context).load(url).error(R.drawable.default_error).into(imageView);
        return imageView;
    }
}
